package biz.alla.market.util;

import java.util.HashSet;
import java.util.Set;

import biz.alla.market.domain.Application;
import biz.alla.market.domain.Category;

public final class ObjectMother {
    private static final ObjectMother instance = new ObjectMother();

    private ObjectMother() {
    }

    public static ObjectMother getInstance() {
	return instance;
    }

    public Set<Application> createApplications(int appCount, int categoryId) {
	Set<Application> applications = new HashSet<Application>();
	for (int count = 0; count < appCount; count++) {
	    Application application = createApplication(count);
	    application.setCategoryId(categoryId);
	    applications.add(application);
	}
	return applications;
    }

    public Application createApplication(int applicationId) {
	Application application = new Application();
	application.setId(applicationId);
	return application;
    }

    public Category createCategory(int categoryId) {
	Category category = new Category();
	category.setId(categoryId);
	return category;
    }
}
